package sk.tuke.constraintbuilder.model;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;

public class TopElement {
	
	private List<RuleElement> elements = new ArrayList<>();
	
	public void addElement(RuleElement element){
		elements.add(element);
	}
	
	@XmlElements({
	    @XmlElement(name = "simple-rule", type = SimpleRuleElement.class),
	    @XmlElement(name = "structured-rule", type = StructuredRuleElement.class),
	})
	public List<RuleElement> getElements(){
		return elements;
	}
	
	public void setElements(List<RuleElement> elements){
		this.elements = elements;
	}
	
	public boolean removeElement(RuleElement element) {
		return elements.remove(element);
	}



}
